import org.jmusixmatch.MusixMatch;
import org.jmusixmatch.MusixMatchException;
import org.jmusixmatch.entity.lyrics.Lyrics;
import org.jmusixmatch.entity.track.Track;
import org.jmusixmatch.entity.track.TrackData;

//test class for lyrics crawling
public class TestLyricsCrawl {
	
	
	public static void main(String[] args) {
			
		
		String apiKey = "b246d9bdf8e7613401289b56a58edeb6";
		MusixMatch musixMatch = new MusixMatch(apiKey);
		
		String trackName = "Gotta Go Home";
		String artistName = "Boney";

		// Track Search [ Fuzzy ]
		Track track = null;
		try {
			track = musixMatch.getMatchingTrack(trackName, artistName);
		} catch (MusixMatchException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		TrackData data = track.getTrack();

		System.out.println("AlbumID : "    + data.getAlbumId());
		System.out.println("Album Name : " + data.getAlbumName());
		System.out.println("Artist ID : "  + data.getArtistId());
		System.out.println("Album Name : " + data.getArtistName());
		System.out.println("Track ID : "   + data.getTrackId());
		
		int trackID = data.getTrackId();
		System.out.println(trackID);

		Lyrics lyrics = null;
		try {
			lyrics = musixMatch.getLyrics(trackID);
		} catch (MusixMatchException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		System.out.println("Lyrics ID       : "     + lyrics.getLyricsId());
		System.out.println("Lyrics Language : "     + lyrics.getLyricsLang());
		System.out.println("Lyrics Body     : "     + lyrics.getLyricsBody());
		System.out.println("Script-Tracking-URL : " + lyrics.getScriptTrackingURL());
		System.out.println("Pixel-Tracking-URL : "  + lyrics.getPixelTrackingURL());
		System.out.println("Lyrics Copyright : "    + lyrics.getLyricsCopyright());
//Test
		
	}

}